package com.bt.dmdb.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ODS_CUSTOMER")
@SuppressWarnings("serial")
public class Customer implements java.io.Serializable {

    private long id;
    private String name;
    private String sourceSystem;
    private Long externalCustId;
    private String others;
    private Set<Site> sites = new HashSet<Site>(0);

    public Customer() {
    }

    public Customer(long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Customer(long id, String name, String sourceSystem, Long externalCustId, String others, Set<Site> sites) {
        this.id = id;
        this.name = name;
        this.sourceSystem = sourceSystem;
        this.externalCustId = externalCustId;
        this.others = others;
        this.sites = sites;
    }

    @Id
    @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "NAME", nullable = false, length = 50)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "SOURCE_SYSTEM", length = 50)
    public String getSourceSystem() {
        return this.sourceSystem;
    }

    public void setSourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
    }

    @Column(name = "EXTERNAL_CUST_ID", precision = 10, scale = 0)
    public Long getExternalCustId() {
        return this.externalCustId;
    }

    public void setExternalCustId(Long externalCustId) {
        this.externalCustId = externalCustId;
    }

    @Column(name = "OTHERS")
    public String getOthers() {
        return this.others;
    }

    public void setOthers(String others) {
        this.others = others;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
    public Set<Site> getSites() {
        return this.sites;
    }

    public void setSites(Set<Site> sites) {
        this.sites = sites;
    }
}
